﻿//=====================================================================================================
// LocalizationLibrary
// The Localization Library is a collection of reusable software components that provide 
// support for localization. This library enables you to localize WPF, Silverlight and WP7 applications.
// (http://localizationlibrary.codeplex.com)
//=====================================================================================================
// Author: Nicola Gallo (Website: www.nicola.gallo.name, Email: nicolagmt@hotmail.it) 
//=====================================================================================================

namespace HelloWorld.Startup.Model
{
    //.NET References
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// Defines the entity Account.
    /// </summary>
    public class Account : INotifyPropertyChanged
    {
        //Events

        public event PropertyChangedEventHandler PropertyChanged;

        //Fields

        private String _name;
        private String _surename;
        private String _email;
        private String _Password;

        //Properties

        /// <summary>
        /// Gets/Sets account's name.
        /// </summary>
        public String Name
        {
            get { return this._name; }
            set 
            {
                if (this._name != value)
                {
                    this._name = value;
                    this.OnPropertyChange("Name");
                }
            }
        }

        /// <summary>
        /// Gets/Sets account's surename.
        /// </summary>
        public String Surename
        {
            get { return this._surename; }
            set 
            {
                if (this._surename != value)
                {
                    this._surename = value;
                    this.OnPropertyChange("Surename");
                }
            }
        }

        /// <summary>
        /// Gets/Sets account's email.
        /// </summary>
        public String Email
        {
            get { return this._email; }
            set 
            {
                if (this._email != value)
                {
                    this._email = value;
                    this.OnPropertyChange("Email");
                }
            }
        }

        /// <summary>
        /// Gets/Sets account's Password.
        /// </summary>
        public String Password
        {
            get { return this._Password; }
            set
            {
                if (this._Password != value)
                {
                    this._Password = value;
                    this.OnPropertyChange("Password");
                }
            }
        }

        //Methods

        /// <summary>
        /// Publishes the PropertyChanged event.
        /// </summary>
        /// <param name="propertyName"></param>
        protected void OnPropertyChange(String propertyName)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
